﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WebComix.Gui
{
    /// <summary>
    /// Просмотр серии веб-комикса.
    /// </summary>
    public class WebComixView : WebComixViewerBase
    {
        static WebComixView()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(WebComixView), new FrameworkPropertyMetadata(typeof(WebComixView)));
        }

        /// <summary>
        /// Обработчик команды "Reload".
        /// </summary>
        /// <param name="e">Параметр события.</param>
        protected override void OnReloadCommand(ExecutedRoutedEventArgs e)
        {
            if (Comix != null)
            {
                Comix.Reload();
            }
        }

        /// <summary>
        /// Комикс.
        /// </summary>
        public WebComixGuiRecord Comix
        {
            get { return (WebComixGuiRecord)GetValue(ComixProperty); }
            set { SetValue(ComixProperty, value); }
        }

        /// <summary>
        /// Комикс.
        /// </summary>
        public static readonly DependencyProperty ComixProperty =
            DependencyProperty.Register("Comix", typeof(WebComixGuiRecord), typeof(WebComixView), new UIPropertyMetadata(null));

        /// <summary>
        /// Цвер фона описания комикса.
        /// </summary>
        public Brush DescriptionBackground
        {
            get { return (Brush)GetValue(DescriptionBackgroundProperty); }
            set { SetValue(DescriptionBackgroundProperty, value); }
        }

        /// <summary>
        /// Цвер фона описания комикса.
        /// </summary>
        public static readonly DependencyProperty DescriptionBackgroundProperty =
            DependencyProperty.Register("DescriptionBackground", typeof(Brush), typeof(WebComixView), new UIPropertyMetadata(Brushes.LightGoldenrodYellow));        
    }
}
